<template>
    <div>
        <Modal v-model="modal" class="modal-full" title="生成节点" width="90%">
            <div v-if="modalShow">
                <Tabs>
                    <Tab-pane label="内容预览">
                        <NodeFactory v-if="isParse" :is-view="true" :node-code="$parent.actionData.code" :is-nf="true" :model="nodeModel" :hasCheck="true"></NodeFactory>
                    </Tab-pane>
                    <Tab-pane label="模型数据">
                        <CodeEditor v-model="nodeModel" lang="json"></CodeEditor>
                    </Tab-pane>
                </Tabs>
            </div>
            <div slot="footer" class="button-panel-button">
                <i-button @click="close">返回</i-button>
            </div>
        </Modal>

    </div>
</template> 

<script>
import ModalBase from '../modalBase'
import $ from '@/common'
import NodeFactory from '@/pages/nf'
import CodeEditor from '@/element/codeEditor'



export default {
    extends: ModalBase,
    props: {
    },
    data() {
        return {
            billModel: {},
            parseModel: {},
            isParse: false
        }
    },
    created() { },
    methods: {
        load() {
            this.isParse = false
            $.link('/service/{app}/dataset/model/eval/{code}', null, {
                param: this.$parent.actionData
            }).then((res) => {
                this.nodeModel = res.data
                this.isParse = true
            })
        },
        actionSubmit() {

        }
    },
    components: {
        NodeFactory,
        CodeEditor
    }
}
</script>

<style lang="less">

</style>
